package com.guigu.buy.controller;

import com.github.pagehelper.PageInfo;
import com.guigu.buy.pojo.Stock;
import com.guigu.buy.service.IStockService;
import com.guigu.vo.StockVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author com.guigu
 * @since 2024-05-15
 */
@CrossOrigin
@Controller
@RequestMapping("/buy/stock")
public class StockController {
    @Autowired
    private IStockService stockService;
//    查询所有的仓库数据
    @RequestMapping("/list/{pageSize}/{pageNo}")
    @ResponseBody
    public PageInfo<Stock> list(@PathVariable int pageSize,
                                @PathVariable int pageNo,
                                @RequestBody StockVo vo){

     return stockService.queryAll(pageNo,pageSize,vo);
 }
}
